<template lang="html">
  <a-layout class="government-affairs table" style="background: #f0f0f0;">
    <div class="table__left">
      <div class="table-list">
        <div class="list__title" v-html="listDataA.title"></div>
        <a class="more" @click="golist(listDataA)">更多 <a-icon type="double-right" /></a>
        <ul class="list__content">
          <li class="list__content-item" v-for="item in listDataA.data" @click="goDetail(item, listDataA)">
            <div class="item__title" v-html="item.FTitle"></div>
            <div class="item__date" v-html="item.FDate"></div>
          </li>
        </ul>
      </div>
    </div>
    <div class="table__right">
      <div class="table-list" style="flex: 1;">
        <div class="list__title" v-html="listDataB.title"></div>
        <a class="more" @click="golist(listDataB)">更多 <a-icon type="double-right" /></a>
        <ul class="list__content">
          <li class="list__content-item" v-for="item in listDataB.data" @click="goDetail(item, listDataB)">
            <div class="item__title" v-html="item.FTitle"></div>
            <div class="item__date" v-html="item.FDate"></div>
          </li>
        </ul>
      </div>
      <div class="table-list" style="flex: 1;">
        <div class="list__title" v-html="listDataC.title"></div>
        <a class="more" @click="golist(listDataC)">更多 <a-icon type="double-right" /></a>
        <ul class="list__content">
          <li class="list__content-item" v-for="item in listDataC.data" @click="goDetail(item, listDataC)">
            <div class="item__title" v-html="item.FTitle"></div>
            <div class="item__date" v-html="item.FDate"></div>
          </li>
        </ul>
      </div>
    </div>
  </a-layout>
</template>

<script>
import {invoke} from "@/api";
export default {
  data () {
    return {
      parentTitle: "政务公开",
      parentURL: "/government-affairs",
      listDataA: {
        title: "政策法规",
        url: "api/WTM.PolicyAndRegulation.perpareNotCheckEdit",
        pageCode: "WTM.PolicyAndRegulation.Edit",
        data: []
      },
      listDataB: {
        title: "工作计划",
        url: "api/WTM.WorkPlan.perpareNotCheckEdit",
        pageCode: "WTM.WorkPlan.Edit",
        data: []
      },
      listDataC: {
        title: "机构职能",
        url: "api/WTM.InstitutionalFunction.perpareNotCheckEdit",
        pageCode: "WTM.InstitutionalFunction.Edit",
        data: []
      }
    }
  },
  mounted() {
    this.loadData()
  },
  methods: {
    goDetail(item, list) {
      this.$router.push({
        path: '/info-page',
        query: {
          FId: item.FId,
          parentTitle: this.parentTitle,
          parentURL: this.parentURL,
          FTitle: list.title,
          url: list.url,
          pageCode: list.pageCode
        }
      })
    },
    loadData() {
      invoke("api/WTM.PolicyAndRegulation.getNotCheckList", {
        pageCode: "WTM.PolicyAndRegulation.List",
        pageSize: 9
      }).then((res) => {
        this.listDataA.data = []
        this.listDataA.data = res.records
      })
      invoke("api/WTM.WorkPlan.getNotCheckList", {
        pageCode: "WTM.WorkPlan.List",
        pageSize: 4
      }).then((res) => {
        this.listDataB.data = []
        this.listDataB.data = res.records
      })
      invoke("api/WTM.InstitutionalFunction.getNotCheckList", {
        pageCode: "WTM.InstitutionalFunction.List",
        pageSize: 4
      }).then((res) => {
        this.listDataC.data = []
        this.listDataC.data = res.records
      })
    },
    golist(list) {
      this.$router.push({
        path: "/list-page",
        query: {
          parentTitle: this.parentTitle,
          parentURL: this.parentURL,
          FTitle: list.title,
          url: list.url,
          pageCode: list.pageCode,
          listURL: list.url,
          listPageCode: list.pageCode
        }
      })
    }
  }
}
</script>

<style lang="scss">
</style>
